package org.abratuhi.kvngroupware.manager;

import java.util.HashMap;

public abstract class Manager<T> {
	private HashMap<String, T> data = new HashMap<String, T>();
	public Manager(){
		
	}
	public boolean contains(String id){
		return data.containsKey(id);
	}
	public void put(String id, T t){
		data.put(id, t);
	}
	public void remove(String id){
		data.remove(id);
	}
	public T get(String id){
		return data.get(id);
	}
	public void clear(){
		data.clear();
	}
	public int size(){
		return data.size();
	}
	public void update(String id, T t){
		if(contains(id)) put(id, t);
	}
	public String[] getkeys(){
		return data.keySet().toArray(new String[data.size()]);
	}
	
	public abstract String[] getDataForWidget();

}
